<!doctype html>
<html>

<head>
  <meta name="generator" content="JSDoc 3.6.11">
  <meta charset="utf-8">
  <title>whatsapp-web.js 1.26.1-alpha.3 &raquo; Class: Chat</title>
  <link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
  <link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
  <link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
  <link href="css/baseline.css" rel="stylesheet">
</head>

<body onload="prettyPrint()">
  <nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
    <div id="jsdoc-navbar-container">
      <div id="jsdoc-navbar-content">
        <a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>26.<wbr>1-alpha.<wbr>3</a>
      </div>
    </div>
  </nav>
  <div id="jsdoc-body-container">
    <div id="jsdoc-content">
      <div id="jsdoc-content-container">
        <div id="jsdoc-main" role="main">
          <header class="page-header">
            <div class="symbol-detail-labels"><span class="label label-kind">class</span></div>
            <h1><small></small><span class="symbol-name">Chat</span></h1>
            <p class="source-link">Source: <a href="structures_Chat.js.html#source-line-10">structures/<wbr>Chat.<wbr>js:10</a></p>
            <div class="symbol-classdesc">
              <p>Represents a Chat on WhatsApp</p>
            </div>
            <dl class="dl-compact">
            </dl>
          </header>
          <section id="summary">
            <div class="summary-callout">
              <h2 class="summary-callout-heading">Properties</h2>
              <div class="summary-content">
                <div class="summary-column">
                  <dl class="dl-summary-callout">
                    <dt><a href="Chat.html#archived">archived</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#id">id</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#isGroup">isGroup</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#isMuted">isMuted</a></dt>
                    <dd>
                    </dd>
                  </dl>
                </div>
                <div class="summary-column">
                  <dl class="dl-summary-callout">
                    <dt><a href="Chat.html#isReadOnly">isReadOnly</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#lastMessage">lastMessage</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#muteExpiration">muteExpiration</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#name">name</a></dt>
                    <dd>
                    </dd>
                  </dl>
                </div>
                <div class="summary-column">
                  <dl class="dl-summary-callout">
                    <dt><a href="Chat.html#pinned">pinned</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#timestamp">timestamp</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#unreadCount">unreadCount</a></dt>
                    <dd>
                    </dd>
                  </dl>
                </div>
              </div>
            </div>
            <div class="summary-callout">
              <h2 class="summary-callout-heading">Methods</h2>
              <div class="summary-content">
                <div class="summary-column">
                  <dl class="dl-summary-callout">
                    <dt><a href="Chat.html#archive">archive()</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#changeLabels">changeLabels(labelIds)</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#clearMessages">clearMessages()</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#clearState">clearState()</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#delete">delete()</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#fetchMessages">fetchMessages(searchOptions)</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#getContact">getContact()</a></dt>
                    <dd>
                    </dd>
                  </dl>
                </div>
                <div class="summary-column">
                  <dl class="dl-summary-callout">
                    <dt><a href="Chat.html#getLabels">getLabels()</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#markUnread">markUnread()</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#mute">mute(unmuteDate)</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#pin">pin()</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#sendMessage">sendMessage(content[, options])</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#sendSeen">sendSeen()</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#sendStateRecording">sendStateRecording()</a></dt>
                    <dd>
                    </dd>
                  </dl>
                </div>
                <div class="summary-column">
                  <dl class="dl-summary-callout">
                    <dt><a href="Chat.html#sendStateTyping">sendStateTyping()</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#syncHistory">syncHistory()</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#unarchive">unarchive()</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#unmute">unmute()</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="Chat.html#unpin">unpin()</a></dt>
                    <dd>
                    </dd>
                  </dl>
                </div>
              </div>
            </div>
          </section>
          <section>
            <h2 id="Chat">new&nbsp;<span class="symbol-name">Chat</span><span class="signature"><span class="signature-params">()</span></span></h2>
            <dl class="dl-compact">
              <dt>Extends</dt>
              <dd><a href="Base.html">Base</a></dd>
            </dl>
          </section>
          <section>
            <h2>Properties</h2>
            <section>
              <h3 id="archived"><span class="symbol-name">archived</span><small class="property-type">
                  &nbsp;boolean</small></h3>
              <p>Indicates if the Chat is archived</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="id"><span class="symbol-name">id</span><small class="property-type">
                  &nbsp;object</small></h3>
              <p>ID that represents the chat</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="isGroup"><span class="symbol-name">isGroup</span><small class="property-type">
                  &nbsp;boolean</small></h3>
              <p>Indicates if the Chat is a Group Chat</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="isMuted"><span class="symbol-name">isMuted</span><small class="property-type">
                  &nbsp;boolean</small></h3>
              <p>Indicates if the chat is muted or not</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="isReadOnly"><span class="symbol-name">isReadOnly</span><small class="property-type">
                  &nbsp;boolean</small></h3>
              <p>Indicates if the Chat is readonly</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="lastMessage"><span class="symbol-name">lastMessage</span><small class="property-type">
                  &nbsp;<a href="Message.html">Message</a></small></h3>
              <p>Last message fo chat</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="muteExpiration"><span class="symbol-name">muteExpiration</span><small class="property-type">
                  &nbsp;number</small></h3>
              <p>Unix timestamp for when the mute expires</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="name"><span class="symbol-name">name</span><small class="property-type">
                  &nbsp;string</small></h3>
              <p>Title of the chat</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="pinned"><span class="symbol-name">pinned</span><small class="property-type">
                  &nbsp;boolean</small></h3>
              <p>Indicates if the Chat is pinned</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="timestamp"><span class="symbol-name">timestamp</span><small class="property-type">
                  &nbsp;number</small></h3>
              <p>Unix timestamp for when the last activity occurred</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="unreadCount"><span class="symbol-name">unreadCount</span><small class="property-type">
                  &nbsp;number</small></h3>
              <p>Amount of messages unread</p>
              <dl class="dl-compact">
              </dl>
            </section>
            <h2>Methods</h2>
            <section>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="archive"><span class="symbol-name">archive</span><span class="signature"><span class="signature-params">()</span></span></h3>
              <p>Archives this chat</p>
              <dl class="dl-compact">
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="changeLabels"><span class="symbol-name">changeLabels</span><span class="signature"><span class="signature-params">(labelIds)</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing void</span></span></h3>
              <p>Add or remove labels to this Chat</p>
              <section>
                <h4>Parameter</h4>
                <table class="jsdoc-details-table">
                  <thead>
                    <tr>
                      <th>Name</th>
                      <th>Type</th>
                      <th>Optional</th>
                      <th>Description</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td>
                        <p>labelIds</p>
                      </td>
                      <td>
                        <p>Array of (number or string)</p>
                      </td>
                      <td>
                        <p>&nbsp;</p>
                      </td>
                      <td>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </section>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code>Promise containing void</code> </p>
                </dd>
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="clearMessages"><span class="symbol-name">clearMessages</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing Boolean</span></span></h3>
              <p>Clears all messages from the chat</p>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code>Promise containing Boolean</code> 
                  <p>result</p>
                  </p>
                </dd>
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="clearState"><span class="symbol-name">clearState</span><span class="signature"><span class="signature-params">()</span></span></h3>
              <p>Stops typing or recording in chat immediately.</p>
              <dl class="dl-compact">
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="delete"><span class="symbol-name">delete</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing Boolean</span></span></h3>
              <p>Deletes the chat</p>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code>Promise containing Boolean</code> 
                  <p>result</p>
                  </p>
                </dd>
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="fetchMessages"><span class="symbol-name">fetchMessages</span><span class="signature"><span class="signature-params">(searchOptions)</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing Array of <a href="Message.html">Message</a></span></span></h3>
              <p>Loads chat messages, sorted from earliest to latest.</p>
              <section>
                <h4>Parameters</h4>
                <table class="jsdoc-details-table">
                  <thead>
                    <tr>
                      <th>Name</th>
                      <th>Type</th>
                      <th>Optional</th>
                      <th>Description</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td>
                        <p>searchOptions</p>
                      </td>
                      <td>
                        <p>Object</p>
                      </td>
                      <td>
                        <p>&nbsp;</p>
                      </td>
                      <td>
                        <p>Options for searching messages. Right now only limit and fromMe is supported.</p>
                        <p>Values in <code>searchOptions</code> have the following properties:</p>
                        <table class="jsdoc-details-table">
                          <thead>
                            <tr>
                              <th>Name</th>
                              <th>Type</th>
                              <th>Optional</th>
                              <th>Description</th>
                            </tr>
                          </thead>
                          <tbody>
                            <tr>
                              <td>
                                <p>limit</p>
                              </td>
                              <td>
                                <p>Number</p>
                              </td>
                              <td>
                                <p>Yes</p>
                              </td>
                              <td>
                                <p>The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.</p>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <p>fromMe</p>
                              </td>
                              <td>
                                <p>Boolean</p>
                              </td>
                              <td>
                                <p>Yes</p>
                              </td>
                              <td>
                                <p>Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.</p>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </section>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code>Promise containing Array of <a href="Message.html">Message</a></code> </p>
                </dd>
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="getContact"><span class="symbol-name">getContact</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing <a href="Contact.html">Contact</a></span></span></h3>
              <p>Returns the Contact that corresponds to this Chat.</p>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code>Promise containing <a href="Contact.html">Contact</a></code> </p>
                </dd>
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="getLabels"><span class="symbol-name">getLabels</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing Array of <a href="Label.html">Label</a></span></span></h3>
              <p>Returns array of all Labels assigned to this Chat</p>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code>Promise containing Array of <a href="Label.html">Label</a></code> </p>
                </dd>
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="markUnread"><span class="symbol-name">markUnread</span><span class="signature"><span class="signature-params">()</span></span></h3>
              <p>Mark this chat as unread</p>
              <dl class="dl-compact">
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="mute"><span class="symbol-name">mute</span><span class="signature"><span class="signature-params">(unmuteDate)</span></span></h3>
              <p>Mutes this chat forever, unless a date is specified</p>
              <section>
                <h4>Parameter</h4>
                <table class="jsdoc-details-table">
                  <thead>
                    <tr>
                      <th>Name</th>
                      <th>Type</th>
                      <th>Optional</th>
                      <th>Description</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td>
                        <p>unmuteDate</p>
                      </td>
                      <td>
                        <p>Date</p>
                      </td>
                      <td>
                        <p>&nbsp;</p>
                      </td>
                      <td>
                        <p>Date at which the Chat will be unmuted, leave as is to mute forever</p>
                        <p>Value can be null.</p>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </section>
              <dl class="dl-compact">
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="pin"><span class="symbol-name">pin</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing boolean</span></span></h3>
              <p>Pins this chat</p>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code>Promise containing boolean</code> 
                  <p>New pin state. Could be false if the max number of pinned chats was reached.</p>
                  </p>
                </dd>
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="sendMessage"><span class="symbol-name">sendMessage</span><span class="signature"><span class="signature-params">(content[, options])</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing <a href="Message.html">Message</a></span></span></h3>
              <p>Send a message to this chat</p>
              <section>
                <h4>Parameters</h4>
                <table class="jsdoc-details-table">
                  <thead>
                    <tr>
                      <th>Name</th>
                      <th>Type</th>
                      <th>Optional</th>
                      <th>Description</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td>
                        <p>content</p>
                      </td>
                      <td>
                        <p>(string, <a href="MessageMedia.html">MessageMedia</a>, or <a href="Location.html">Location</a>)</p>
                      </td>
                      <td>
                        <p>&nbsp;</p>
                      </td>
                      <td>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <p>options</p>
                      </td>
                      <td>
                        <p><a href="global.html#MessageSendOptions">MessageSendOptions</a></p>
                      </td>
                      <td>
                        <p>Yes</p>
                      </td>
                      <td>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </section>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code>Promise containing <a href="Message.html">Message</a></code> 
                  <p>Message that was just sent</p>
                  </p>
                </dd>
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="sendSeen"><span class="symbol-name">sendSeen</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing Boolean</span></span></h3>
              <p>Set the message as seen</p>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code>Promise containing Boolean</code> 
                  <p>result</p>
                  </p>
                </dd>
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="sendStateRecording"><span class="symbol-name">sendStateRecording</span><span class="signature"><span class="signature-params">()</span></span></h3>
              <p>Simulate recording audio in chat. This will last for 25 seconds.</p>
              <dl class="dl-compact">
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="sendStateTyping"><span class="symbol-name">sendStateTyping</span><span class="signature"><span class="signature-params">()</span></span></h3>
              <p>Simulate typing in chat. This will last for 25 seconds.</p>
              <dl class="dl-compact">
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="syncHistory"><span class="symbol-name">syncHistory</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing boolean</span></span></h3>
              <p>Sync chat history conversation</p>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code>Promise containing boolean</code> 
                  <p>True if operation completed successfully, false otherwise.</p>
                  </p>
                </dd>
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="unarchive"><span class="symbol-name">unarchive</span><span class="signature"><span class="signature-params">()</span></span></h3>
              <p>un-archives this chat</p>
              <dl class="dl-compact">
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="unmute"><span class="symbol-name">unmute</span><span class="signature"><span class="signature-params">()</span></span></h3>
              <p>Unmutes this chat</p>
              <dl class="dl-compact">
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span></div>
              <h3 id="unpin"><span class="symbol-name">unpin</span><span class="signature"><span class="signature-params">()</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing boolean</span></span></h3>
              <p>Unpins this chat</p>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code>Promise containing boolean</code> 
                  <p>New pin state</p>
                  </p>
                </dd>
              </dl>
            </section>
          </section>
        </div>
      </div>
      <nav id="jsdoc-toc-nav" role="navigation"></nav>
    </div>
  </div>
  <footer id="jsdoc-footer" class="jsdoc-footer">
    <div id="jsdoc-footer-container">
      <p>
        Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on November 22, 2024.
      </p>
    </div>
  </footer>
  <script src="scripts/jquery.min.js"></script>
  <script src="scripts/tree.jquery.js"></script>
  <script src="scripts/prettify.js"></script>
  <script src="scripts/jsdoc-toc.js"></script>
  <script src="scripts/linenumber.js"></script>
  <script src="scripts/scrollanchor.js"></script>
</body>

</html>